

function example_alertBox( boxText )
{		
	if(timeoutID)
	{
	   SqueezeBox.close();	
	}
	
	var options = {size: {x: 300, y: 250}};
	SqueezeBox.initialize(options);
	SqueezeBox.setContent('string',boxText);
			
}


function ajaxpage(url,contenedor){
   window.addEvent( 'domready', function() {
     $(contenedor).empty().addClass(contenedor);
     $(contenedor).innerHTML = "<img class='cargando' ></img> Cargando por favor espere ...";
	var x = new Request({
            url: url,
	    method: 'GET',
	    onComplete: function( response ) {
		$(contenedor).innerHTML = response;
	      }
          }).send();
      });

  }//fin de la funcion ajaxpage
  

function ventana(url,titulo,ancho,alto){
	if(!ancho) ancho=300;
	if(!alto) alto=100;
     reqDialog = new MooDialog.Request(url,null,{
		'class': 'MooDialog myDialog',
		autoOpen: false,
                title: titulo,
                onInitialize: function(wrapper){
			wrapper.setStyle('opacity', 0);
			this.fx = new Fx.Morph(wrapper, {
				duration: 600,
				transition: Fx.Transitions.Bounce.easeOut
			});
			this.overlay = new Overlay(this.options.inject, {
				duration: this.options.duration
			});
			if (this.options.closeOnOverlayClick) this.overlay.addEvent('click', this.close.bind(this));
		},
		onBeforeOpen: function(){
			this.overlay.open();
			this.fx.start({
				'width': [ancho],
				'height': [alto],
				'margin-top': [-200, -100],
				opacity: [0, 1]
			}).chain(function(){
				this.fireEvent('show');
			}.bind(this));
		},
		onBeforeClose: function(){
			this.fx.start({
				'margin-top': [-100, 0],
				opacity: 0
			}).chain(function(){
				this.fireEvent('hide');
			}.bind(this));
			this.overlay.close();
		} 
	});
	// You want the request dialog instance to set the onRequest message, so you have to do it in two steps.
	reqDialog.setRequestOptions({
		onRequest: function(){
		    reqDialog.setContent('Cargando...');
		}
	}).open();
}

